AIX Commands and Concepts

Everything can be done using smit command. Smit is a menu base program where you can execute all system administration functions. But doing things on command prompt is more flexible. Commands are tested on AIX 4.3. Find here few commands to start of:

  1. Device management
  2. Command

    Description

    lsdev

    Display devices in system and their characteristics

    lsdev -C

    Display information about all devices in the Customised

    Devices object class using the -C flag.

    lsdev -P -H

    Display information about all devices in the Predefined Devices object class using the -P flag. Also include header.

    lsdev -Cc disk

    Display devices in class disk

    lsdev -Cc tape

    Display devices in class tape

    lsdev -Cc cdrom

    Display devices in class CDROM

    cfgmgr

    Configures devices and optionally installs device software

    rmdev -l rmt0

    Remove a device

    rmdev -l rmt0 -d

    Remove a device and its entry from database.

    lsattr -El rmt0

    Displays attribute characteristics values of attributes for device rmt0

    chdev -l rmt0 -a block_size=0

    Change attribute value. Current attribute values from lsattr command

    lsdev -Cc memory

    Display devices in class memory

    lsattr -El mem0

    Display attributes for memory module mem0.

     

     

    The device definition can have three states in AIX. The figure above shows these three states and commands to change the device states.

     

  3. Disks, Volumes and File Systems
  4. Command

    Description

    lsvg

    Displays information about volume groups.

    lsvg rootvg

    Display information about rootvg.

    lsvg -p rootvg

    Display physical volumes.

    lsvg -l rootvg

    Display logical volumes.

    Mkvg

    Create a new volume group, using the physical volumes

    extendvg

    Adds physical volumes to a volume group.

    Reducevg

    Remove physical volumes from a volume group. When all physical volumes removed from the volume group, the group is deleted.

    Command

    Description

    Lspv

    Displays information about a physical volume within a vg.

    lspv hdisk0

    Display information about physical volume hdisk0.

    varyonvg datavg

    Activates volume group.

    varyonvg datavg

    Deactivates volume goup.

    exportvg datavg

    Removes the definition of the volume group datavg from the system.

    importvg

    Imports a volume group definition from a set of physical volumes.

     

  5. Steps to create Logical Volume and Filesystem
  6. Create a logical volume test in rootvg with 4 logical partions and using physical disk hdisk0.

    # mklv -y test rootvg 4 hdisk0

    List all the logical volumes in rootvg, and

    # lsvg -l rootvg

    There can be three mirrors of an lv. The command below shows details of all three for lv test.

    # lslv -m test

    If currently there is only one copy, more can be added to total three. Make a total of 2 copies with the new copy on hdisk1.

    # mklvcopy test 2 hdisk1

    Add 2 more logical partitions to lv test.

    # extendlv test 2

    If staus in lsvg -l rootvg is open/stale, use following to sync

    # syncvg -l test

    It is easy to make filesystem in a lv by using smit fs . Create a filesystem. The /etc/filesystems file is similar to /etc/vfstab in solaris. It contains mount info for all filesystems. Filesystem size can also be changed from same menu but from command line:

    # chfs -a size=+32000 /test

    Remove a lv from one disk

    # rmlvcopy test 1 hdisk0

    Or migarte from one disk to other

    # migratepv -l test hdisk0 hdisk1

    Remove a filesystem and logical volume

    # rmfs /test

    # rmlv test

     See the command dump here for steps to create a logical volume and filesystems.

  7. Manage Swap Space
  8. List paging space

    # lsps -a

    Make paging device with four logical partitions from rootvg

    # mkps -a -s4 rootvg hdisk0

    The newly created paging device will be listed in logical volume list of rootvg.

    # lsvg -l rootvg

    Specify additional swap devices

    # swapon /dev/pagging00

    Change the size of paging space

    # chps -s4 paging00

    Inactivate on next reboot.

    # chps -n paging00

    File /etc/swapspaces specifies the paging space devices activated by the swapon -a

    command.

     

  9. Manage inittab file
  10. The /etc/inittab file supplies the script to the init command's role as a general process dispatcher. Following are commands to manage this file:

    # lsitab -a

    # chitab

    # mkitab

    # rmitab

    # telinit Q

  11. Memory Information
  12. To find total memory in system if you are root or any other user:

    # bootinfo -r

    $ lsattr -E -l sys0 -a realmem

    Also for more details

    # lsdev -C -c memory

    # lsattr -E -lmem0

     

  13. Miscellaneous Helpful Commands

To create an information dump to be sent to IBM support.

# snap -a

# snap -gfkD

To Performs hardware problem determination and to change boot device list. Boot list is the list of boot devices from where you can boot your system i.e. diskette, tape, cdrom, disk etc

# diag